import os
import django

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'airshow_web.settings')
django.setup()

from django.db import connection
from airshow.models import Area

def print_area_objects():
    print("\n区域模型对象:")
    areas = Area.objects.all()
    
    # 打印模型信息
    print(f"模型元数据: {Area._meta}")
    print(f"表名: {Area._meta.db_table}")
    print(f"主键字段: {Area._meta.pk.name}")
    print(f"所有字段: {[f.name for f in Area._meta.fields]}")
    
    # 打印数据
    for area in areas:
        print(f"\n区域ID: {area.area_id}")
        print(f"区域名称: {area.name}")
        print(f"区域位置: {area.location}")

if __name__ == "__main__":
    print_area_objects()
    print("\n完成检查") 